import gameCtrl from "./gameCtrl";
import gameView from "./gameView";

const {ccclass, property} = cc._decorator;

@ccclass
export default class gameScene extends cc.Component {
    @property(cc.Prefab)
    gameView:cc.Prefab = null

    private gameViewScr:gameView = null
    private gameCtrlSrc:gameCtrl = null

    start () {
        this.gameViewScr = cc.instantiate(this.gameView).getComponent('gameView')
        this.gameViewScr.node.parent = this.node
        this.gameCtrlSrc = new gameCtrl()
        this.gameCtrlSrc.init(this.gameViewScr)
        this.gameCtrlSrc.play()
    }

   onDestroy(){
       this.gameCtrlSrc.exit()
   }
}
